<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home | 深大人的微型博客</title>
<link rel="stylesheet" type="text/css" href="css/home.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="iecss.css" />
<![endif]-->
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript" src="js/home.js"></script>
<script type="text/javascript" src="js/weibo_counter.js"></script>
<script type="text/javascript" src="js/concerns_ajax.js"></script>
<script type="text/javascript" src="js/comment.js"></script>
<script type="text/javascript" src="js/transpond.js"></script>
<script type="text/javascript" src="js/collection.js"></script>
<script type="text/javascript" src="js/weibo_ajax.js"></script>
<script type="text/javascript" src="js/home_loadmore.js"></script>
<script type="text/javascript">

$(function(){       
	
	/*重新计算微博框剩余可输入字数*/
   	$("#speach_content").bind("blur focus keydown keypress keyup", function(){           
   		recount($("#counter"),$("#speach_submit"),$("#speach_content"));       
	});
   	$("#speach_submit").click(function(){
   		recount($("#counter"),$("#speach_submit"),$("#speach_content")); 
   		$("#picture").hide();
   	});
   	/*重新计算转发框剩余可输入字数*/
   	$("#zhuanfa_info").bind("blur focus keydown keypress keyup", function(){        
   		recount($(this).prev(".zhuanfa_tips").find("#counter"),$(this).next("#zhuanfa_submit"),$(this)); 
	});
 	/*隐藏与打开评论框*/ 
   	$("div#comment_box").hide();

   	$(".weibo_button a:contains('评论')").live('click',function(){
		$(this).parent().nextAll("#comment_box").toggle();
		return false;
	}); 

   	/*关闭与打开转发框*/
	$("#zhuanfa_box").hide();
	
	$(".weibo_button a:contains('转发')").live('click',function(){
		var tWindow = $(this).parent().nextAll("#zhuanfa_box");
		var tFace = $(this).parent().nextAll("#transpond_face");
		$("#mask").toggle();
		showDialog(tWindow,tFace);
		tWindow.toggle();
		return false;
	}); 
	$("#zhuanfa_box .zhuanfa_titlebox .zhuanfa_close a").live('click',function(){
		$(this).parents("#zhuanfa_box").hide();
		$(this).parents("#zhuanfa_box").nextAll("#transpond_face").hide();
		$("#mask").hide();
	});
	/*打开转发框表情框*/
	$("#zhuanfa_box #speach_expression").live('click',function(){
		$(this).parent().next("#transpond_face").toggle();
		return false;
	});
	$("#transpond_face .face_close").live('click',function(){
		$("#transpond_face").hide();	
	});
	/*
	*根据当前页面与滚动条位置，设置转发框的top与left
	*/
	function showDialog(subWindow,face){
		var objW = $(window);	//当前窗口
		var objT = subWindow;	//要显示的对话框
		var objF = face;
		var brsW = objW.width();	//当然窗口的宽
		var brsH = objW.height();	//当前窗口的高
		var sclL = objW.scrollLeft();	//当前窗口滚动条相对最左位置
		var sclT = objW.scrollTop();	//当前窗口滚动条相对最上位置
		var curW = objT.width();	//对话框的宽
		var curH = objT.height();	//对话框的高

		//计算对话框居中时的左边距
		var tLeft = sclL + (brsW - curW) / 2;
		//计算对话框居中时的上边距
		var tTop = sclT + (brsH - curH) / 2;
		//表情框左边距
		var fLeft = sclL + (brsW - curW) / 2;
		//表情框上边距
		var fTop = sclT + (brsH - curH) / 2 + curH + 10;
		//设置对话框在页面中的位置
		objT.css({"left": tLeft, "top": tTop});
		objF.css({"left": fLeft, "top": fTop, "width": curW});
	}
	/*当前窗口大小改变时，改变转发框的位置*/
	$(window).resize(function()	{
		if(!$("#zhuanfa_box").is(":visible")) {
			return;
		}
		showDialog($("#zhuanfa_box"),$("#transpond_face"));
	});

	/*打开表情框*/
	$("#speach #speach_expression_w,#speach #speach_expression").click(function(){
		$("#face").toggle();
		return false;
	});
	$(":not(#face,#speach_expression_w,#speach_expression)").click(function(){
		$("#face").hide();
	});
	$(".face_close").click(function(){
		$("#face").hide();	
	});
	
	/*打开图片上传框*/
	$("#speach #speach_picture_w,#speach #speach_picture").click(function(){
		$("#picture").toggle();
		var str = "*发布图片*";
		var obj = $("#speach_content").get(0);
		if (document.selection) {
			obj.focus();
		    var sel = document.selection.createRange();
		    sel.text = str;
		} else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
				var startPos = obj.selectionStart;
				var endPos = obj.selectionEnd;
				var tmpStr = obj.value;
				obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
		} else {           
			obj.value += str;
		}
		recount($("#counter"),$("#speach_submit"),$("#speach_content")); 
		return false;
	});
	$("#picture .picture_close").click(function(){
		$("#picture").hide();	
	});

	/*微博框插入表情*/
	$("#speach #face .face_content img").click(function(){
		var strL = "[";
		var strR = "]";
		var str = strL + $(this).attr("name") + strR;
		var obj = $("#speach_content").get(0);
		if (document.selection) {
			obj.focus();
		    var sel = document.selection.createRange();
		    sel.text = str;
		} else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
				var startPos = obj.selectionStart;
				var endPos = obj.selectionEnd;
				var tmpStr = obj.value;
				obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
		} else {           
			obj.value += str;
		}
		recount($("#counter"),$("#speach_submit"),$("#speach_content")); 	
	});

	/*转发框插入表情*/
	$("#transpond_face .face_content img").live('click',function(){
		var strL = "[";
		var strR = "]";
		var str = strL + $(this).attr("name") + strR;
		var obj = $(this).parents("#transpond_face").prev("#zhuanfa_box").find("#zhuanfa_info").get(0);
		if (document.selection) {
			obj.focus();
		    var sel = document.selection.createRange();
		    sel.text = str;
		} else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
				var startPos = obj.selectionStart;
				var endPos = obj.selectionEnd;
				var tmpStr = obj.value;
				obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
		} else {           
			obj.value += str;
		}
		recount($(this).parents("#transpond_face").prev("#zhuanfa_box").find("#counter"),$("#zhuanfa_submit"),$(this).parents("#transpond_face").prev("#zhuanfa_box").find("#zhuanfa_info"));	
	});
	$(".friend_accept a").hover(function(){
		$(this).css("color","#ffffff");
	},function(){
		$(this).css("color","#000000");
		});

	/*搜索框控制*/
	$("#searchinfo").focus(function(){
		$("#searchinfo").val("");
	});
	$("#searchinfo").blur(function(){
		if(!$("#searchinfo").val()){
			$("#searchinfo").val("找微博,找人");
		}
	});
	$("#search").click(function(){
		if(!$("#searchinfo").val()){
			return false;
		}
		else if($("#searchinfo").val() == "找微博,找人"){
			return false;
		}
		else{	
			return true;
		}
	});
	/*放大图片*/
	$(".weibo_photo img").live('click',function(){
		if($(this).attr("width") == "150"){
			$(this).attr("width","400");
		}
		else $(this).attr("width","150");
	});
	$(".weibo_t_photo img").live('click',function(){
		if($(this).attr("width") == "150"){
			$(this).attr("width","400");
		}
		else $(this).attr("width","150");
	});

	
}); 
</script>
	


</head>
<body onload="startdate(),startTime()">

<?php
include_once 'msg_redirect.php';	/*通过使用cookie，当检查出未登陆，则不予进入home.php，返回index.php*/
if($_COOKIE['TTU'] != "logined"){
	msg_redirect("您还未登录哦！", "index.php");
}?>
<div id="mask"></div>
<div id="main_container">

	<div id="header" >

       <div class="top_right">
       
            <div class="weather">
              <div class="weather_text" id="date"></div>
              <div class="weather_text" id="time"></div>
              <div class="weather_img">
              <a href="#"><img src="image/w_cloudy.png" border="0" width="60" height="60"/></a></div>
            </div>
            
            <div class="big_banner">
            <a href="#"><img src="image/life.jpg" border="0" width="180" height="100"/></a>
            <a href="#"><img src="image/love.jpg"  border="0" width="180" height="100"/></a>
            <a href="#"><img src="image/reading.jpg" border="0" width="180" height="100"/></a>
         </div>
        
        </div>
    
  
        <div id="logo">
            <a href="index.html"><img src="image/logo.png" alt="" title="" border="0" width="240" height="125" /></a>
	    </div>
        

        

    </div>
    
   <div id="main_content">
     <div id="menu_tab">
       <ul id="menu">
         <li><a href="home.php">首 页</a></li>
         <li><a href="#">热 门 <img src="image/more.png" /></a>
           <ul>
             <li><a href="hotpeople.php">微博达人</a></li>
             <li><a href="hotweibo.php">热门微博</a></li>
           </ul>
         </li>
         <li><a href="#">应 用 <img src="image/more.png" /></a>
           <ul>
             <li><a href="photo.php">相册</a></li>
             <li><a href="collection.php">收藏</a></li>
             <li><a href="find.php">找人</a></li>
             <li><a href="#">我的课表</a></li>
             <li><a href="#">公文通</a></li>
           </ul>
         </li>
         <li><a href="my_weibo.php">我的主页</a></li>
         <li><a href="#">消 息 <img src="image/more.png" /></a>
           <ul>
             <li><a href="comment.php">查看评论</a></li>
             <li><a href="cencerns_from.php">查看粉丝</a></li>
             <li><a href="my_concerns.php">查看关注</a></li>
           </ul>
         </li>
         <li><a href="#">帐 号 <img src="image/more.png" /></a>
           <ul>
             <li><a href="account_info">帐号设置</a></li>
             <li><a href="logout.php">注销</a></li>
           </ul>
         </li>
       </ul>
     </div>
     <!-- end of menu tab -->
            
    
    <div class="left_content">
     <div class="title_box">我的状态</div>  
     <div class="border_box">
         <div class="user_title"><?php 
                           /*显示昵称*/
                           include_once("sql_connect.php");
                           include_once("msg_redirect.php");
                   
                            $u_no = $_COOKIE['u_no'];
    						$user_sql = mysql_query("select u_name from user_info where u_no='$u_no'",$connection);
    						$user_result = mysql_fetch_array($user_sql);
    						$user_data = $user_result[0];   						
    						echo "$user_data";
    						?></div>
         <div class="user_img"><a href="details.html"><a href="details.html"><img src="<?php 
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						include_once 'msg_redirect.php';
    						$u_no = $_COOKIE['u_no'];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$u_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "head_image/09.jpg";
    						}
    						else echo "$my_data";
    						?>" width="100" height="100" /></a></a></div>
         <div class="button_box">
         <div id="concernsNum_button" class="button"><a href="my_concerns.php">关注<?php
                           /*显示关注数量*/
                           include_once("sql_connect.php");
                           include_once("msg_redirect.php");
  
                            $u_no = $_COOKIE['u_no'];
    						$show_sql = mysql_query("select max(c_num) from concerns where u_no='$u_no'",$connection);
    						$show_result = mysql_fetch_array($show_sql);
    						$my_data = $show_result[0];   						
    						echo "$my_data";
    						  ?></a></div>
         <div class="button"><a href="cencerns_from.php">粉丝<?php
                           /*显示粉丝数量*/
                           include_once("sql_connect.php");
                           include_once("msg_redirect.php");
  
                            $u_no = $_COOKIE['u_no'];
    						$show_sql = mysql_query("select max(f_num) from concerns where c_no='$u_no'",$connection);
    						$show_result = mysql_fetch_array($show_sql);
    						$my_data = $show_result[0];   						
    						echo "$my_data";
    						  ?></a></div>
         <div id="weiboNum_button" class="button"><a href="my_weibo.php">微博<?php
                           /*显示微博数量*/
                           include_once("sql_connect.php");
                           include_once("msg_redirect.php");
  
                            $u_no = $_COOKIE['u_no'];
    						$show_sql = mysql_query("select max(w_num) from weibo where u_no='$u_no'",$connection);
    						$show_result = mysql_fetch_array($show_sql);
    						$my_data = $show_result[0];   						
    						echo "$my_data";
    						  ?></a></div>
         </div>
     </div> 
     
     <div class="title_box">关于我</div>
    
        <ul class="left_menu">
        <li class="odd"><a href="home.php">首页</a></li>
        <li class="even"><a href="comment.php">评论</a></li>
         <li class="odd"><a href="collection.php">收藏</a></li>
         <li class="even"><a href="photo.php">相册</a></li>
         <li class="odd"><a href="">课表</a></li>
        </ul> 
             
     
     <div class="title_box">待增加区域</div>
     <div class="banner_adds"><a href="#"><img src="image/reading.jpg" alt="" title="" border="0" height="180" width="100"/></a></div>    
        
    
   </div><!-- end of left content --> 



   <div class="center_content">
   	<div class="center_title_bar">发表微博</div>
	  	<div class="user_name"><img src="image/speach_name.png"/></div>
	  	<div class="seapch_tips">请文明用语,还能输入<span id="counter">140</span>字</div>
	  	<div class="speach" id="speach"><form  id="speach_form" name="speach_form" method="post">
		  	<textarea id="speach_content" class="speach_content" name="speach_content"></textarea>
		  	<div id="speach_expression" class="speach_image"><a href = "javascript:void(0)" ><img src="image/face.jpg" width="18" height="18" /></a></div>
       	  	<div id="speach_expression_w" class="speach_image_w"><a href = "javascript:void(0)">表情</a></div>
        	<div id="speach_picture" class="speach_image"><a href="#"><img src="image/picture.jpg" width="18" height="18" /></a></div>
       	  	<div id="speach_picture_w" class="speach_image_w"><a href="#">图片</a></div>          
        	<input name="speach_submit" class="speach_submit" id="speach_submit" type="button" value="发 布" />
            <div style="padding-top:135px;">
        	<div id="face">
        		<div class="face_title">常用表情</div>
        		<div class="face_close"><a href="javascript:void(0)">关闭</a></div>
        		<div class="face_content">
    				<?php 
    				/*输出表情*/
    				include_once 'sql_connect.php';
    				include_once 'msg_redirect.php';
    				$my_sql = mysql_query("select * from expression",$connection);
    				$my_result = mysql_fetch_array($my_sql);
    				if($my_result){
    					do{
    				?>
    						<div class="face_img"><a href="javascript:void(0)">
    							<?php echo "<img src='".$my_result[e_url]."' name='".$my_result[e_name]."'/>"?>
    							</a>
    						</div>
    				<?php 
    					}
    					while($my_result = mysql_fetch_array($my_sql));
    				}
    				?>
				</div>
        	</div>
        </div>
        </form>
        
        <div style="margin-left:70px;">
        	<div id="picture">
        		<div class="picture_title">上传图片</div>
        		<div class="picture_close"><a href="javascript:void(0)">关闭</a></div>
        		<div style="clear:both;"></div>
        		<div class="picture_content">
            	<iframe id="upload_wpic" src="upload_wpic.php";width="200"height="300"scrolling="no"frameborder="0"></iframe> 
        		</div>
        	</div>
        </div>
	</div>
   
   
   	<div class="center_title_bar">微博主体</div>
    <div id="weibo_box">
    <?php 
    /*循环输出weibo表中关注者微博的内容，同时输出头像，昵称，发布微博的时间*/
    include_once 'sql_connect.php'; 
    include_once 'msg_redirect.php';
	$u_no = $_COOKIE['u_no'];
    
    $my_sql = mysql_query("SELECT weibo.u_no,w_content,w_date,u_name,h_id,w_id,t_id,p_id FROM weibo,user_info WHERE weibo.u_no IN(SELECT c_no FROM concerns WHERE u_no='$u_no' ) and user_info.u_no IN(SELECT c_no FROM concerns WHERE u_no='$u_no' ) and weibo.u_no=user_info.u_no ORDER BY w_date DESC LIMIT 0,20",$connection);
		
    $my_result = mysql_fetch_array($my_sql);
    if($my_result){
    do{
    ?>
   	<div class="weibo_box">
   		<span id="weibo_id" style="display:none"><?php echo $my_result[w_id];?></span>
    	<div class="weibo_img"><a href="##"><img src="<?php 
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						include_once 'msg_redirect.php';
    						$u_no = $my_result['u_no'];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$u_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "head_image/09.jpg";
    						}
    						else echo "$my_data";
    						?>" width="50" height="50" /></a></div>
        <div class="weibo_content">        
        	    <?php
        	    /*输出昵称和微博内容*/ 
        	    include_once 'utilities/show_expression.php';
	    		echo "<font color='#06f'>".$my_result[u_name]."</font>".": ".show_expression($my_result[w_content]);
	    		?>
	    
	    <?php 
        /*转发的显示*/
        include_once("sql_connect.php");
        
        $t_id = $my_result[t_id];
        
        if($t_id !="0"){
        	do{
        	include_once("sql_connect.php");
      	
        	$weibo_sql= mysql_query("SELECT weibo.u_no,w_content,w_date,u_name,h_id,w_id,t_id,p_id FROM weibo,user_info WHERE w_id='$t_id' AND user_info.u_no IN(SELECT u_no FROM weibo WHERE w_id='$t_id')");
        	$weibo_result2= mysql_fetch_array($weibo_sql);
        	
        	$t_id =$weibo_result2[t_id];
        	/*判断是不是最终的微博*/
        	if($t_id =="0"){ 
        	/*最终的微博,另开一个框*/ ?>
            			 
       	    <div class='weibo_t_content'>
            <div class='weibo_t_bg'> 
			<?php   
        	include_once 'utilities/show_expression.php';
	        echo "<font color='#06f'>"."@".$weibo_result2[u_name]."</font>".": ".show_expression($weibo_result2[w_content]);
	        				        
	        ?>
            
			<div class='weibo_t_photo'><img <?php if($weibo_result2[p_id]!="0"){
								/*输出相片*/
        						include_once 'sql_connect.php'; 
        						$p_id= $weibo_result2['p_id'];
    							$photo_sql2 = mysql_query("select p_data from photo where p_id='$p_id'",$connection);
    							$photo_result2 = mysql_fetch_array($photo_sql2);
    							$my_data = $photo_result2[p_data];
    							echo "src='";
    							echo "$my_data";   
								echo "'"." width='150'";			
									}	?> /></div>
			<div class='weibo_t_button'>转发(<?php 
                           /*显示转发次数*/
                           include_once("sql_connect.php");                                            
                            $w_id = $weibo_result2[w_id];
                            /*检查weibo表中w_id（微博id）最大t_times（微博转发次数）*/
                            $weibo_sql = mysql_query("select t_times from weibo WHERE w_id = '$w_id'",$connection);	
                            $weibo_result = mysql_fetch_array($weibo_sql);
    						$weibo_data = $weibo_result[0];   						
    						echo "$weibo_data";
    						?>)&nbsp;|&nbsp;评论(<?php 
    						/*显示评论次数*/
                           include_once("sql_connect.php");                   
                            $w_id = $weibo_result2[w_id];
                            /*检查comment表中w_id（微博id）最大w_ctimes（微博评论次数）*/
                            $comment_sql = mysql_query("select MAX(w_ctimes) from comment WHERE w_id = '$w_id'",$connection);	
                            $comment_result = mysql_fetch_array($comment_sql);
    						$comment_data = $comment_result[0];  
    						if ($comment_data){
    							echo "$comment_data";
    						}
    						else echo "0";
    						?>)</div> 
			<div class='weibo_t_time'> <?php include_once 'timeConverter.php';	echo timeConverter($weibo_result2[w_date]);?></div>	    	 
			<s><i></i></s>
            </div> 
			</div>  <?php 
        	} 
        	else {	            
        	/*如果不是最终微博,则直接输出*/	       
        	echo "<span class=''>";        
        	include_once 'utilities/show_expression.php';
	    	echo "<font color='#06f'>"."@".$weibo_result2[u_name]."</font>".": ".show_expression($weibo_result2[w_content]);
	   		echo " </span> ";	
        	}
        	
        	
        	}while($t_id);
        }
        ?>    
	    
        </div>
        
        <?php 
        $p_id= $my_result['p_id'];
        if($p_id!="0"){
        
        ?>
        
        <div class="weibo_photo"><img src="<?php
        						/*输出相片*/
        						include_once 'sql_connect.php'; 
        						$p_id= $my_result['p_id'];
    							$photo_sql = mysql_query("select p_data from photo where p_id='$p_id'",$connection);
    							$photo_result = mysql_fetch_array($photo_sql);
    							$my_data = $photo_result[p_data];
    							echo "$my_data";   							        						
        						?>" width="150"/>
        </div>
       <?php }?>
        <div class="weibo_button"><a href="javascript:void(0);">转发(<?php 
                           /*显示转发次数*/
                           include_once("sql_connect.php");                                            
                            $w_id = $my_result[w_id];
                            /*检查weibo表中w_id（微博id）最大t_times（微博转发次数）*/
                            $weibo_sql = mysql_query("select t_times from weibo WHERE w_id = '$w_id'",$connection);	
                            $weibo_result = mysql_fetch_array($weibo_sql);
    						$weibo_data = $weibo_result[0];   						
    						echo "$weibo_data";
    						?>)</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:void(0);">收藏
    						</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href = "javascript:void(0);">评论(<?php 
                           /*显示评论次数*/
                           include_once("sql_connect.php");                   
                            $w_id = $my_result[w_id];
                            /*检查comment表中w_id（微博id）最大w_ctimes（微博评论次数）*/
                            $comment_sql = mysql_query("select MAX(w_ctimes) from comment WHERE w_id = '$w_id'",$connection);	
                            $comment_result = mysql_fetch_array($comment_sql);
    						$comment_data = $comment_result[0];   						
    						if ($comment_data){
    							echo "$comment_data";
    						}
    						else echo "0";
    						?>)</a></div>
        <div class="weibo_time">
        <?php include_once 'timeConverter.php';	echo timeConverter($my_result[w_date]);?></div>
        <div id="comment_box">
        <div class="comment_bg">
        <span id="weibo_id" style="display:none"><?php echo $my_result[w_id];?></span>
        <div contenteditable="true" type="text" name="comment_info" class="comment_info" ></div>
        <input name="speach_submit" class="comment_submit" id="comment_submit" type="button" value="评 论" />
        
   
        <div id="comment_wrap">       
        <?php 	
        /*微博评论显示*/
		include_once 'sql_connect.php';
		include_once 'msg_redirect.php';
		include_once 'timeConverter.php';
        $comment_sql = mysql_query("SELECT c_id,c_content,c_date,u_no,r_id FROM comment WHERE w_id='$my_result[w_id]'",$connection);	
        $comment_result = mysql_fetch_array($comment_sql);
		if($comment_result){
			do {
				if($comment_result[r_id]=="0"){
		?>
			
			<div class="comment_sbox">
            <div class="comment_border"></div>
			<div class="comment_img"><a href="##"><img src="<?php 
					/*显示头像*/
        			$show_head_sql = mysql_query("select h_data from head where u_no='$comment_result[u_no]'",$connection);
    				$show_head_result = mysql_fetch_array($show_head_sql);
    				$my_data = $show_head_result[h_data];
    				if (!$my_data){
    					echo "head_image/09.jpg";
    					}
    				else echo "$my_data";
					?>" alt="" title="" width="30" height="30" border="0" /></a></div>

					<div class="comment_content">
					<?php 
					/*显示人名*/
					$show_user = mysql_query("select u_name from user_info where u_no = '$comment_result[u_no]'",$connection);
					$show_user_result = mysql_fetch_array($show_user);
					echo $show_user_result[0].":".$comment_result[c_content]."(".timeConverter($comment_result[c_date]).")";?>
					</div>                                        
				</div>
					
		<?php 
				}
				else{
					?>
			<div class="comment_sbox">
            <div class="comment_border"></div>
			<div class="comment_img"><a href="##"><img src="<?php 
					/*显示头像*/
        			$show_head_sql = mysql_query("select h_data from head where u_no='$comment_result[u_no]'",$connection);
    				$show_head_result = mysql_fetch_array($show_head_sql);
    				$my_data = $show_head_result[h_data];
    				if (!$my_data){
    					echo "head_image/09.jpg";
    					}
    				else echo "$my_data";
					?>" alt="" title="" width="30" height="30" border="0" /></a></div>

					<div class="comment_content">
					<?php 
					/*显示人名*/
					$show_user = mysql_query("select u_name from user_info where u_no = '$comment_result[u_no]'",$connection);
					$show_user_result = mysql_fetch_array($show_user);
					echo $show_user_result[0].":";
					$comment_sql2= mysql_query("select u_name from user_info where u_no in(select u_no from comment where c_id='$comment_result[r_id]')",$connection);
					$comment_result2 = mysql_fetch_array($comment_sql2);
					echo "回复@".$comment_result2[u_name].":".$comment_result[c_content]."(".timeConverter($comment_result[c_date]).")";?>
					</div>                                        
				</div>
			<?php 	}
				}while ($comment_result = mysql_fetch_array($comment_sql));
			}
		?>
        </div>
        <s><i></i></s>
		</div>
        </div>
        <div class="weibo_border"></div>
		<div id="zhuanfa_box">
			<span id="weibo_id" style="display:none"><?php echo $my_result[w_id];?></span>
			<div class="zhuanfa_titlebox">
    			<div class="zhuanfa_title">转发</div>
        		<div class="zhuanfa_close"><a href="javascript:void(0)">关闭</a></div>
    		</div>
    		<div id="speach_expression" class="speach_image"><a href = "javascript:void(0)" ><img src="image/face.jpg" width="18" height="18" /></a></div>
    		<div class="zhuanfa_tips">还能输入<span id="counter">140</span>字</div>
<!--    		<div contenteditable="true" type="text" name="zhuanfa_info" class="zhuanfa_info" id="zhuanfa_info"></div>-->
			<textarea name="zhuanfa_info" class="zhuanfa_info" id="zhuanfa_info"></textarea>
    		<input name="zhuanfa_submit" class="zhuanfa_submit" id="zhuanfa_submit" type="button" value="转 发" />   
		</div>
		<div id="transpond_face">
        		<div class="face_title">常用表情</div>
        		<div class="face_close"><a href="javascript:void(0)">关闭</a></div>
        		<div class="face_content">
    				<?php 
    				/*输出表情*/
    				include_once 'sql_connect.php';
    				include_once 'msg_redirect.php';
    				$tHead_sql = mysql_query("select * from expression",$connection);
    				$tHead_result = mysql_fetch_array($tHead_sql);
    				if($tHead_result){
    					do{
    				?>
    						<div class="face_img"><a href="javascript:void(0)">
    							<?php echo "<img src='".$tHead_result[e_url]."' name='".$tHead_result[e_name]."'/>"?>
    							</a>
    						</div>
    				<?php 
    					}
    					while($tHead_result = mysql_fetch_array($tHead_sql));
    				}
    				?>
				</div>
        	</div>
        
         
    </div>
    <?php 
    }while ($my_result=mysql_fetch_array($my_sql));}
	?>
	
	</div>
	<div style="clear:both;"></div>
    <div id="load_more"><span id="load_num" style="display:none;">20</span><div id="load_words">加载更多微博</div></div>
   </div><!-- end of center content -->



 <div class="right_content">
 
     <div class="title_box">搜索感兴趣的</div>  
     <div class="border_box">
     	<form action="findresult_weibo.php" method="get">
			<input type="text" name="searchinfo" id="searchinfo" class="searchinfo_input" value="找微博,找人"/>
        	<input type="submit" name="search" id="search" value="搜索>>"/>
        </form>
     </div>  
     

     
 
   		<div class="friend_box">
        	<div class="title_box">可能认识的人<?php 
    /*循环输出user_info表中没有被u_no关注的人，同时输出头像，昵称*/
    include_once 'sql_connect.php'; 
	$u_no = $_COOKIE['u_no'];    
    $my_sql = mysql_query("SELECT user_info.u_name,h_id,u_no FROM user_info WHERE user_info.u_no NOT IN(SELECT c_no FROM concerns WHERE u_no= '$u_no' ) LIMIT 0,3 ",$connection);
	$my_result = mysql_fetch_array($my_sql);
	
    if($my_result){
    	do{
    ?></div>
            
            <div class="friend_icon"><a href="#" title=""><img src="<?php 
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						$u_no = $my_result['u_no'];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$u_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "head_image/09.jpg";
    						}
    						else echo "$my_data";
    						?>" width="35" height="35" /></a></div>
            
            <div class="friend_details">
            	<a href="javascript:void(0)" class="friend_name"><?php echo "<font color='#06f'>".$my_result[u_name]?> </a><br />
            	<span class="border_f"></span>
            	<div class="friend_accept"><a href="javascript:void(0)">+加关注</a></div>
            	<?php 
               	}while ($my_result=mysql_fetch_array($my_sql));}
	        	?>
            </div>



            
            <a href="#" class="more">更多&gt;&gt;</a>
                 
      </div>
   
   
     <div class="title_box">公文通最新资讯</div>  
     <div class="border_box">
         <div class="user_title">标题</div>
         <div>
           <p><a href="details.html">内容缩写</a></p>
           <p>65465465</p>
           <p>65465465</p>
           <p>65465446</p>
        </div>
         <div><a href="#" class="search">更多&gt;&gt;</a></div>
     </div>  
     
     
     
    <div class="title_box">人气排行</div>
     <?php 
       /*新添加代码:人气排行前三*/
	  include_once 'sql_connect.php'; 
    						
      $concerns_sql = mysql_query("select c_no,max(f_num)num from concerns   group by c_no  order by num desc limit 0,8"); 
      $concerns_result = mysql_fetch_array($concerns_sql);
	  $number = 1;
      $i = 0;
      if($concerns_result!=""){
      	do{      		
      ?>
    
        <ul class="right_menu">
      		<?php 
      		if($i==0){
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						$c_no = $concerns_result[0];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$c_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "<li class='odd'><a href=''><img src='head_image/09.jpg' alt='' title='' width='25' height='25' border='0' />";
    						}
    						else echo "<li class='odd'><a href=''><img src='$my_data' alt='' title='' width='25' height='25' border='0' />"; 
                           /*显示昵称*/
                           include_once("sql_connect.php");                   
                            $c_no = $concerns_result[0];
    						$user_sql = mysql_query("select u_name from user_info where u_no='$c_no'",$connection);
    						$user_result = mysql_fetch_array($user_sql);
    						$user_data = $user_result[0];   						
    						echo "&nbsp;$user_data</a></li>";
    						$i++;
      				}
    						  
    	 	else { 		  						
 
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						$c_no = $concerns_result[0];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$c_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "<li class='even'><a href=''><img src='head_image/09.jpg' alt='' title='' width='25' height='25' border='0' />";
    						}
    						else echo "<li class='even'><a href=''><img src='$my_data' alt='' title='' width='25' height='25' border='0' />";
                           /*显示昵称*/
                           include_once("sql_connect.php");                   
                            $c_no = $concerns_result[0];
    						$user_sql = mysql_query("select u_name from user_info where u_no='$c_no'",$connection);
    						$user_result = mysql_fetch_array($user_sql);
    						$user_data = $user_result[0];   						
    						echo "&nbsp;$user_data</a></li>";
    						$i--;
    				}
    		?>
    						

        </ul>      
	  <?php 
        /*新添加代码:人气排行前三，循环语句*/
      	}while($concerns_result = mysql_fetch_array($concerns_sql));
      }
      ?>     
     <div class="banner_adds">
     

     <a href="#"><img src="<?php 
							/*用以输出人气第一用户端的头像*/
							include_once 'sql_connect.php'; 
							
      						$concerns_sql = mysql_query("select c_no,max(f_num)num from concerns   group by c_no  order by num desc "); 
      						$concerns_result = mysql_fetch_array($concerns_sql); 
      						$c_no = $concerns_result[0];   						
							
      						
    						$show_head_sql = mysql_query("select h_data from head where u_no='$c_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "head_image/09.jpg";
    						}
    						else echo "$my_data";
    						?>" alt="" title="" border="0" height="150" width="120"/></a>
     </div>        
     
   </div><!-- end of right content -->   


            
   </div><!-- end of main content -->
   
   
   
   <div class="footer">深圳大学计算机与软件学院@毕业设计项目网站<br />指导老师：王华明<br />项目负责：陈作鑫<br />
    小组成员：陈作鑫&nbsp;&nbsp;陈志杰&nbsp;&nbsp;赖晓东
    </div>                 


</div>
<!-- end of main_container -->


</body>
</html>